home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / Demos / Mac / Matthew's Behaviors / Matthew'sMotionƒ / spin < prev   
Encoding:
INI File  |  2001-09-10  |  1.3 KB  |  38 lines

  1. [Name]
  2. Spin - From Matthew's Motion Suite.
  3. By Matthew Peterson, matthew@pinoko.berkeley.edu
  4.  
  5. [Description]
  6. 2-19-2000
  7. Drop this on a sprite, and it will spin in 3D
  8.  
  9. [Parameters]
  10.  
  11. [Frame loaded]
  12. spritevars originalspincenterx originalspincentery spincenterx spincentery spinanglestep originalheight
  13.  
  14. spriteofid($thisspriteid).executeevent(200082)
  15. originalheight = spriteofid($thisspriteid).boundsbottom - spriteofid($thisspriteid).boundstop
  16. originalspincenterx = spincenterx
  17. originalspincentery = spincentery
  18. spinanglestep = 7
  19.  
  20. [Idle]
  21. SpriteVars spinangle spinanglestep originalheight originalspincenterx originalspincentery spincenterx spincentery spinanglestep
  22. localvars temporaryx temporaryy spinheight
  23.  
  24. spinangle = spinangle + spinanglestep
  25. resetmatrix
  26. rotate(spinangle)
  27. spinheight = (SecondCornerY - FirstCornerY) * 0.1
  28. Stretch(FirstCornerX,SecondCornerY - spinheight,SecondCornerX, SecondCornerY + spinheight, SecondCornerX,SecondCornerY + originalheight - spinheight,FirstCornerX,SecondCornerY + originalheight + spinheight)
  29. executeevent(200082)
  30. MoveBy(originalspincenterx- spincenterx,originalspincentery - spincentery)
  31.  
  32.  
  33. [200082 MP_CalculateSpinCenter]
  34. spritevars spincenterx spincentery
  35. //get the center of the sprite
  36. spincenterx = (boundsleft + boundsright)/2
  37. spincentery =  (boundstop + boundsbottom)/2
  38.